package com.atnjupt.regexp;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Wizarder
 * @create 2022-03-22 13:51
 */
public class RegTest {
    public static void main(String[] args) {
        String context = "123-abc";
        String regx = "[2-]";
        Pattern compile = Pattern.compile(regx);
        Matcher matcher = compile.matcher(context);
        while (matcher.find()){
            System.out.println("找到了:" + matcher.group(0));
        }
    }
}
